import 'package:flip_card/flip_card.dart';
import 'package:flutter/material.dart';

class OpenCardPage extends StatefulWidget {
  const OpenCardPage({Key key}) : super(key: key);

  @override
  _OpenCardPageState createState() => _OpenCardPageState();
}

class _OpenCardPageState extends State<OpenCardPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("翻卡"),
      ),
      body: FlipCard(
        direction: FlipDirection.HORIZONTAL, // default
        front: Container(
          width: MediaQuery.of(context).size.width * 0.4,
          height: MediaQuery.of(context).size.height * 0.6,
          alignment: Alignment.center,
          child: Text('Front'),
          decoration: BoxDecoration(
            color: Colors.blue
          ),
        ),
        back: Container(
          child: Text('Back'),
        ),
      ),
    );
  }
}
